<!DOCTYPE html>
<html lang="">
<head>
    <meta charset="UTF-8">
    <script src="https://unpkg.com/typewriter-effect@2.3.1/dist/core.js"></script>
    <title>打字机效果</title>
</head>
<body>

<h1 id="typewriter"></h1>

<script>
    const typewriter = new Typewriter('#typewriter', {
        loop: true, // 循环播放
        delay: 75,   // 每个字符的延迟
    });

    typewriter
        .typeString('我的名字是张三')
        .pauseFor(1000)
        .typeString('<strong>我是一个AI智能回答助手</strong>')
        .pauseFor(1000)
        .deleteChars(12)
        .typeString('<span style="color: blue;">这是一个打字机效果</span>')
        .pauseFor(1000)
        .start();
</script>

</body>
</html>